<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>罚息金额</title>
    <style type="text/css">
    </style>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>

<body style="padding: 0 23px;">
<form id="interest_form">
    <div class="fieldset1  clearFix">
        <div class="fieldBox col_100">
            <div class="label">罚息金额(元):</div>
            <div class="field">
                <input name="ovdpenalty" id="ovdpenalty" type="text" class="ui-textbox" value=""/>
            </div>
        </div>
        <div class="fieldBox col_100">
            <div class="field">
                <span name="mark" id="mark" ></span>
            </div>
        </div>
    </div>
    <div class="btnsBox" style="text-align: center;">
        <span id="update_Btn" class="sq-button sq-button-round l-dialog-btn-ok">更新</span>
        <span id="close_Btn" class="sq-button sq-button-round l-dialog-btn-ok">关闭</span>
    </div>
</form>

<script type="text/javascript">
    $(function () {
        var ovdpenalty = '${ovdPenaltyAmt}';
        $('#ovdpenalty').val(FormatMoney(ovdpenalty/100));
        var mark = '${mark}'
        if(mark == 1){
            $('#mark').html("罚息金额=今日更新过来的罚息金额");
        }else if(mark == 2){
            $('#mark').html("罚息金额=今日更新过来的罚息金额+本次冲红分解单中状态为已推送罚息金额+逾期本金、逾期利息之差（资方—我司，负数按照0计算）");
        }

    });

    //关闭
    $('#close_Btn').click(function (event) {
        frameElement.dialog.hide();
    });

    //更新
    $('#update_Btn').click(function (event) {
        var id = '${id}';
        var paySchId = '${paySchId}';
        var data={};
        data.id=id
        data.paySchId=paySchId;
        var udateValue=$('#ovdpenalty').val().replace(/,/g,"")
        data.penaltyAmt= udateValue;
        $.ajax({
            type: 'post',
            dataType: 'json',
            data: data,
            url: '<%=path%>/capital/capOvdErrLog/updateBusiProcessing.do',
            beforeSend: function () {
                wait_dialog = $.ligerDialog.SQalert({
                    content: LogUtils.LOG_CMM_DATA_LOADING,
                    SQ_type: "waitting"
                });
            },
            success: function (msg) {
                wait_dialog.close();
                if (msg.success == 1) {
                    $.ligerDialog.SQalert({content: msg.info, SQ_type: "success"});
                    parent.$("#clearBtn").click();
                    parent.$("#searchBtn").click();
                    frameElement.dialog.close();
                } else {
                    $.ligerDialog.SQalert({content: msg.info, SQ_type: "error"});
                }
            }
        });
    });


</script>

</body>
</html>
